package com.zjc.yohoshop.mvp.view.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zjc.yohoshop.R;
import com.zjc.yohoshop.bean.CollectionListEntity;
import com.zjc.yohoshop.network.API;

/**
 * 收藏 -> 普通商品 —> 适配器
 */
public class CollectionListPTAdapter extends BaseQuickAdapter<CollectionListEntity, BaseViewHolder> {
    public CollectionListPTAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, CollectionListEntity item) {
        Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.goods_img).into((ImageView) helper.getView(R.id.iv_item_collection_list_pt_img));
        helper.setText(R.id.tv_item_collection_list_pt_name, item.goods_name);
        helper.setText(R.id.tv_item_collection_list_pt_price, "￥" + item.goods_price);
    }
}
